package org.csu.sei.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.csu.sei.common.BaseConstant;
import org.csu.sei.entity.Category;

import java.time.LocalDateTime;
import java.util.List;

public interface ICategoryService extends IService<Category> {

    //查询
    Category queryCategory(Long id);

    //新增类别
    Category insertCategory(Category category);

    //删除类别
    int deleteCategory(Long id);

    //更新类型
    int updateCategory(Category category);

    //批量删除
    int deleteSome(List<Long> idList);

    //批量改变状态
    int setLook(List<Long> idList, int status);

    //获取制定id类型的子类型
    List<Category> queryChildren(Long id,  boolean selectInviable) ;

    List<Category> queryAllCategory( boolean selectInviable);

    int changeOrder(Long id,Long pid,List<Long> childrenOrder);

    int changeStatus(Long id);

    int changeCategoryName(Long id,String name);

    List<Category> queryALLChildrenCategory(Long id, boolean selectInviable);

    List<Category> queryCategoryByTitleId(Long id, boolean selectInviable);

    JSONObject router( boolean selectInviable);

    JSONArray tree(boolean includeHomePage);
    JSONArray queryBar();

    LocalDateTime getLatestUpdateTime(Long id);

    int changeTitleCategory(Long id,Long tid);
    int changeUsedCategory(List<Long> used);

    JSONObject titleCategoryList();

    int changeOrder(Long id,int order);

    List<Category> getUnusedCategory();

    int changeUnusedCategoryOrder(int order);

    // 获取所有的category的数量
    int getCount();
}
